include ("forixinc.php");
include ("co_util.php");
include ("util.php");
switch ($lin)
{
case $linEng:
$tit_local=array("Suggest a new Stat-ix chart topic","Suggestion:","Thanks for the suggestion!","Submit a comment for the above chart","Comment:","Best comments will be published in FORIX","Thanks for the comment!","You must complete all fields!");
break;
case $linFra:
$tit_local=array("Proposez votre propre Stat-ix","Proposition :","Merci de votre proposition !","Un commentaire du tableau ci-dessus ?","Commentaire :","Les meilleurs commentaires seront publiés sur FORIX","Merci de votre commentaire !","Tous les champs doivent être renseignés !");
break;
case $linPor:
$tit_local=array("Sugira um tópico para um novo gráfico Stat-ix","Sugestão:","Obrigado pela sugestão!","Envie um comentário sobre este gráfico","Comentário:","Os melhores comentários serão publicados no FORIX","Obrigado pelo comentário!","Deve completar todos os campos do formulário!");
break;
case $linBra:
$tit_local=array("Sugira um tópico para um novo gráfico Stat-ix","Sugestão:","Obrigado pela sugestão!","Envie um comentário sobre este gráfico","Comentário:","Os melhores comentários serão publicados no FORIX","Obrigado pelo comentário!","Deve completar todos os campos do formulário!");
break;
default:
$tit_local=array("","","","","","","","");
break;
}
function cht_show_image()
{
extract($GLOBALS);
$SQLQuery="SELECT notes.*, contactos.copynote FROM notes inner join contactos on notes.autor=contactos.sig WHERE (notes.lin=".$lin;
if ($lin_base[$lin]>0)
{
$SQLQuery=$SQLQuery." or lin=".$lin_base[$lin];
}
if ($lin!=$linEng)
{
$SQLQuery=$SQLQuery." or lin=".$linEng;
}
$SQLQuery=$SQLQuery.") and notes.cref=".$REF_CHT;
if ($ref>0)
{
$SQLQuery=$SQLQuery." and notes.ref=".$ref;
}
if ($super_modo<$Modo_privado)
{
$SQLQuery=$SQLQuery." and notes.ref<=".$hiso;
}
$SQLQuery=$SQLQuery." Order by notes.ref desc, notes.lin desc Limit 1";
if (($result = mysql_query($SQLQuery)) and ($RSList = mysql_fetch_array($result)))
{
$ref=$RSList["ref"];
tab_bar(2);
?>
echo pri_data(intval(substr($ref,6,2)),intval(substr($ref,4,2)),substr($ref,0,4),1); ?>
$tit=$RSList["titulo"];
if (strlen($tit)>4)
{
?> echo $tit; ?>
}
?> |
tab_bar(4);
tab_bor();
tab_bar1(10);
?>_.gif"> |
tab_bar1(10);
$txt=$RSList["texto"];
if (strlen($txt)>4)
{
?> echo str_replace("#args#",$args,$txt); ?> |
|
}
if ($super_modo==$Modo_total)
{
?>[
if (strlen($tit)>4 && $lin==$RSList["lin"])
{
?>&c=14">Edit
}
else
{
?>Insert
}
?>]
}
?> |
}
else
{
?> echo $titulo[$N_NONE]; ?> |
}
return $function_ret;
}
function cht_index()
{
extract($GLOBALS);
$SQLQuery="SELECT notes.*, contactos.copynote FROM notes inner join contactos on notes.autor=contactos.sig WHERE (lin=".$lin;
if ($lin_base[$lin]>0)
{
$SQLQuery=$SQLQuery." or lin=".$lin_base[$lin];
}
if ($lin!=$linEng)
{
$SQLQuery=$SQLQuery." or lin=".$linEng;
}
$SQLQuery=$SQLQuery.") and notes.cref=".$REF_CHT;
if ($super_modo<$Modo_privado)
{
$SQLQuery=$SQLQuery." and notes.ref<=".$hiso;
}
$SQLQuery=$SQLQuery." Order by notes.ref desc, notes.lin desc";
if (($result = mysql_query($SQLQuery)) and mysql_num_rows($result) > 0)
{
tab_bor();
tab_bar2(6);
?>
tab_bar2(6);
}
return $function_ret;
}
function cht_menu()
{
extract($GLOBALS);
if ($tit_local[0]>"")
{
tab_bor();
tab_bar(4);
?> echo $tit_local[3]; ?> echo $tit_local[0]; ?> |
tab_bar(4);
}
return $function_ret;
}
function cht_show($ref)
{
tab_ini();
cht_show_image();
cht_index();
cht_menu();
tab_fim();
}
function cht_form($tit)
{
extract($GLOBALS);
?>
tab_bar2(6);
return $function_ret;
}
function cht_record($user, $mail, $txt)
{
global $email_jpc, $ref, $tip;
if (strlen($user)>0 && strlen($mail)>0 && strlen($txt)>0)
{
$n=substr($lin+100,strlen($lin+100)-(2))."_".$ref;
$t=$n." ".$user." - ".$mail.chr(13).chr(10).$ref.chr(13).chr(10).$txt;
log_file("St_".$n."_",$t);
mail ($email_jpc, $n, $t, "From: statix@forix.com\r\n");
return 1;
}
return 2;
}
function cht_suggest()
{
extract($GLOBALS);
tab_ini();
$user=trim(post_arg("name"));
$mail=trim(post_arg("email"));
$txt=trim(post_arg("txt"));
if ($tip==1)
{
$tip = cht_record($user, $mail, $txt);
}
if ($tip==0 || $tip==2)
{
tab_bar(2);
?> Stat-ix |
tab_bar(4);
tab_bor();
if ($tip==2)
{
tab_bar2(4);
?> echo $tit_local[7]; ?> |
tab_bar2(4);
}
cht_form("".$tit_local[1]."");
}
if ($tip==1)
{
cht_show_image();
tab_bor();
?> echo $tit_local[2]; ?> |
cht_index();
cht_menu();
}
tab_fim();
return $function_ret;
}
function cht_comment()
{
extract($GLOBALS);
tab_ini();
cht_show_image();
tab_bor();
$user=trim(post_arg("name"));
$mail=trim(post_arg("email"));
$txt=trim(post_arg("txt"));
if ($tip==1)
{
$tip = cht_record($user, $mail, $txt);
}
if ($tip==0 || $tip==2)
{
if ($tip==2)
{
tab_bar2(4);
?> echo $tit_local[7]; ?> |
tab_bar2(4);
}
cht_form("".$tit_local[4]." (".$tit_local[5].")");
}
if ($tip==1)
{
?> echo $tit_local[6]; ?> |
}
cht_index();
if ($tip==1)
{
cht_menu();
}
tab_fim();
return $function_ret;
}
$cmd=intval(get_arg("c"));
$ref=intval(get_arg("r"));
$tip=intval(get_arg("t"));
$user="";
$mail="";
$txt="";
log_page($REF_CHT,$ref,$cmd);
fxhead("Forix: Stat-ix");
if ($cmd==1)
{
cht_suggest();
}
else
if ($cmd==2)
{
cht_comment();
}
else
{
cht_show($ref);
}
fxtail();
?>